package exercise;

/**
 * @ClassName Sector
 * @Deacription TODO
 * @Author 谢忠辉
 * @Date 2021/3/16 0016 10:55
 **/
public class Sector extends Shape{
    public double radius ;
    public double arcLength;
    public final double P = 3.14 ;

    public Sector(double radius, double arcLength) {
        super("扇形");
        this.radius = radius;
        this.arcLength = arcLength;
    }

    @Override
    public void calculate() {
        area = (arcLength/(2*P*radius)) * P*radius*radius;

    }

    @Override
    public void show() {
        calculate();
        System.out.println("这个扇形的半径：" + radius + " 弧长：" + arcLength + "面积：" +area );
    }
}
